 <!DOCTYPE html>
<html>


<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>文章菜单</title>


    <link rel="shortcut icon" href="__PUB__/favicon.ico"> 
    <link href="__CSS__/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__CSS__/animate.min.css" rel="stylesheet">
    <link href="__CSS__/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="__CSS__/page.css" rel="stylesheet">
 	<script  src="__JS__/jquery.min.1.8.1.js" ></script>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>文章列表</h5>
                        <div class="ibox-tools">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="{:U('Article/ad')}" title ="添加">
                                <i class="fa fa-file-text-o"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-3">
                            <form action="{:U('Article/lst')}"  method ="post" >
                                <div class="input-group">
                                    <input type="text" placeholder="请输入作者/文章标题的关键词" class="input-sm form-control" name ="search"> 
                                    <span class="input-group-btn">
                                       <input type="submit" class="btn btn-sm btn-primary" value="搜索" />
                                    </span>
                                </div>
                            </form>
                            </div>
                        </div>
                        <form action="{:U('Article/del_both')}"  method ="post"  >
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th><input type="checkbox" class="i-checks" id="checks_both" /></th>
                                        <th>文章ID</th>
                                        <th>文章标题</th>
                                        <th>导读标签</th>
                                        <th>配图</th>
                                        <th>作者</th>
                                        <th>状态</th>
                                        <th>分类</th>
                                        <th>优质推荐</th>
                                        <th>页面轮播</th>
                                        <th>首页轮播</th>
                                        <th>首页精品导读</th>
                                        <th>首页热门榜单</th>
                                        <th>发布日期</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <volist name="article" id="vo">
	                                <tbody>
	                                    <tr>
	                                        <td>
	                                            <input type="checkbox"  class="i-checks ckeck"name="del_both[ ]" value="{$vo.id}" />
	                                        </td>
	                                        <td>{$vo.id}</td>
	                                        <td>{$vo.title}</td>
	                                        <td>{$vo.tags}</td>
	                                        <if condition="$vo[url] eq ''">
	                                       		<td>暂无</td>
	                                       	<else/>
	                                       		<td><img  src="{$vo.url|substr=1}" height="50" /></td> 
	                                       	</if>
	                                        <td>{$vo.author}</td> 
	                                        <!-- <td>{$vo.content|htmlspecialchars_decode|mb_substr=0,10,'utf-8'}</td> --> 
	                                        <td>
		                                       <if condition="$vo[status] eq 1">
													<span style="color:Green">已显示</span>
		                                       <else/>
		                                       		<span style="color:red">未显示</span>
		                                       </if>
	                                        </td> 
	                                        <td>
		                                        <volist name="cat_list" id="v">
										       		<switch name="vo.classify">
										       			<case value="$v.cid">{$v.name}</case>
										       		</switch>
									       		</volist>
									        </td>
									        
									   <if condition="$vo.is_recom eq 1">   
	                                        <td style="text-align: center;"><i id="recom{$vo.id}" class="fa fa-check text-navy" onclick="recomme_case2({$vo.id});"></i></td>
	                                    <else/>
	                                    	<td style="text-align: center;"><i id="recom{$vo.id}" class="fa fa-times text-navy" onclick="recomme_case({$vo.id});"></i></td>
	                                    </if>
	                                    
	                                   <if condition="$vo.is_banner eq 1">   
	                                        <td style="text-align: center;"><i id="banner{$vo.id}" class="fa fa-check text-navy" onclick="banner_case2({$vo.id});"></i></td>
	                                    <else/>
	                                    	<td style="text-align: center;"><i id="banner{$vo.id}" class="fa fa-times text-navy" onclick="banner_case({$vo.id});"></i></td>
	                                    </if>
	                                    
	                                    
	                                    <if condition="$vo.index_banner eq 1">   
	                                        <td style="text-align: center;"><i id="index{$vo.id}" class="fa fa-check text-navy" onclick="index_case2({$vo.id});"></i></td>
	                                    <else/>
	                                    	<td style="text-align: center;"><i id="index{$vo.id}" class="fa fa-times text-navy" onclick="index_case({$vo.id});"></i></td>
	                                    </if>
									        
									   <if condition="$vo.index_recom eq 1">   
	                                        <td style="text-align: center;"><i id="index_recom{$vo.id}" class="fa fa-check text-navy" onclick="index_recom2({$vo.id});"></i></td>
	                                    <else/>
	                                    	<td style="text-align: center;"><i id="index_recom{$vo.id}" class="fa fa-times text-navy" onclick="index_recom({$vo.id});"></i></td>
	                                    </if>
	                                    
	                                    <if condition="$vo.index_hot eq 1">   
	                                        <td style="text-align: center;"><i id="index_hot{$vo.id}" class="fa fa-check text-navy" onclick="index_hot2({$vo.id});"></i></td>
	                                    <else/>
	                                    	<td style="text-align: center;"><i id="index_hot{$vo.id}" class="fa fa-times text-navy" onclick="index_hot({$vo.id});"></i></td>
	                                    </if>
	                                    
	                                        
	                                        <td>{$vo.createtime|date ="Y-m-d H:i:s",###}</td>
	                                        <td> 
	                                        <a href="{:U('Article/edt',array('id'=>$vo['id']))}"title ="修改"><i class="fa fa-edit text-navy"></i></a>&nbsp;&nbsp;
	                                        <a href="{:U('Article/del',array('id'=>$vo['id']))}"title ="删除"><i class="fa fa-times text-navy" onclick="return confirm('确定要删除吗？');"></i></a>
	                                        </td>
	                                    </tr>
	                                </tbody>
                                </volist>
                            </table>
                        </div>
                        <input type="submit" value="全部删除" onclick="return confirm('您确定要删除这些吗？');"class ="btn btn-sm btn-primary "/>
                        </form>
						
						<div class ="pagination">{$page}</div>

                    </div>
                </div>
            </div>

        </div>
    </div>

    <script>
    	$("#checks_both").click(function(){
       	 if($(this).attr("checked")){
    			$(".ckeck").attr("checked","checked");
    		}else{
    			$(".ckeck").removeAttr("checked");
    		}
    	})
    	
	
    </script>
    <script >
	//case页面优质项目显示
	var cs=0;
	function recomme_case(id){  				
	    if(cs==0){
	    	var is_recom =1;
	        $.post('recomme_case',{id:id,is_recom:is_recom},function(){
	        	
	        })
	    	$('#recom'+id).removeClass('fa-times');
	    	$('#recom'+id).addClass('fa-check');
	        cs=1;
	    }else{
	    	$('#recom'+id).removeClass('fa-check');
	    	$('#recom'+id).addClass('fa-times');
	        cs=0;
	    	var is_recom =0;
	        $.post('recomme_case',{id:id,is_recom:is_recom},function(){
	        	
	        })
	    }
	
	}


//case页面优质项目显示
	var cs2 =0;
	function recomme_case2(id){
	if(cs2==0){
			var is_recom =0;
		    $.post('recomme_case',{id:id,is_recom:is_recom},function(){
		    	
		    })
			$('#recom'+id).removeClass('fa-check');
			$('#recom'+id).addClass('fa-times');
		    cs2=1;
	
	}else{
			var is_recom =1;
		    $.post('recomme_case',{id:id,is_recom:is_recom},function(){
		    	
		    })
			$('#recom'+id).removeClass('fa-times');
			$('#recom'+id).addClass('fa-check');
		    cs2=0;
		}
	}
    
	//banner 页面轮播
	var cb=0;
	function banner_case(id){  				
	    if(cb==0){
	    	var is_banner =1;
	        $.post('banner_case',{id:id,is_banner:is_banner},function(){
	        	
	        })
	    	$('#banner'+id).removeClass('fa-times');
	    	$('#banner'+id).addClass('fa-check');
	        cb=1;
	    }else{
	    	$('#banner'+id).removeClass('fa-check');
	    	$('#banner'+id).addClass('fa-times');
	        cb=0;
	    	var is_banner =0;
	        $.post('banner_case',{id:id,is_banner:is_banner},function(){
	        	
	        })
	    }
	
	}


//banner  页面轮播
	var cb2 =0;
	function banner_case2(id){
	if(cb2==0){
			var is_banner =0;
		    $.post('banner_case',{id:id,is_banner:is_banner},function(){
		    	
		    })
			$('#banner'+id).removeClass('fa-check');
			$('#banner'+id).addClass('fa-times');
		    cb2=1;
	
	}else{
			var is_banner =1;
		    $.post('banner_case',{id:id,is_banner:is_banner},function(){
		    	
		    })
			$('#banner'+id).removeClass('fa-times');
			$('#banner'+id).addClass('fa-check');
		    cb2=0;
		}
	}
    
	//banner 首页轮播
	var cd=0;
	function index_case(id){  				
	    if(cd==0){
	    	var index_banner =1;
	        $.post('index_case',{id:id,index_banner:index_banner},function(){
	        	
	        })
	    	$('#index'+id).removeClass('fa-times');
	    	$('#index'+id).addClass('fa-check');
	        cd=1;
	    }else{
	    	$('#index'+id).removeClass('fa-check');
	    	$('#index'+id).addClass('fa-times');
	        cd=0;
	    	var index_banner =0;
	        $.post('index_case',{id:id,index_banner:index_banner},function(){
	        	
	        })
	    }
	
	}


//banner  首页轮播
	var cc2 =0;
	function index_case2(id){
	if(cc2==0){
			var index_banner =0;
		    $.post('index_case',{id:id,index_banner:index_banner},function(){
		    	
		    })
			$('#index'+id).removeClass('fa-check');
			$('#index'+id).addClass('fa-times');
		    cc2=1;
	
	}else{
			var index_banner =1;
		    $.post('index_case',{id:id,index_banner:index_banner},function(){
		    	
		    })
			$('#index'+id).removeClass('fa-times');
			$('#index'+id).addClass('fa-check');
		    cc2=0;
		}
	}
    
	
	//banner 首页轮播
	var cf=0;
	function index_recom(id){  				
	    if(cf==0){
	    	var index_recom =1;
	        $.post('index_recom',{id:id,index_recom:index_recom},function(){
	        	
	        })
	    	$('#index_recom'+id).removeClass('fa-times');
	    	$('#index_recom'+id).addClass('fa-check');
	        cf=1;
	    }else{
	    	$('#index_recom'+id).removeClass('fa-check');
	    	$('#index_recom'+id).addClass('fa-times');
	        cf=0;
	    	var index_recom =0;
	        $.post('index_recom',{id:id,index_recom:index_recom},function(){
	        	
	        })
	    }
	
	}


//banner  首页轮播
	var cf2 =0;
	function index_recom2(id){
	if(cf2==0){
			var index_recom =0;
		    $.post('index_recom',{id:id,index_recom:index_recom},function(){
		    	
		    })
			$('#index_recom'+id).removeClass('fa-check');
			$('#index_recom'+id).addClass('fa-times');
		    cf2=1;
	
	}else{
			var index_recom =1;
		    $.post('index_recom',{id:id,index_recom:index_recom},function(){
		    	
		    })
			$('#index_recom'+id).removeClass('fa-times');
			$('#index_recom'+id).addClass('fa-check');
		    cf2=0;
		}
	}
	
	//banner 首页轮播
	var ch=0;
	function index_hot(id){  				
	    if(ch==0){
	    	var index_hot =1;
	        $.post('index_hot',{id:id,index_hot:index_hot},function(){
	        	
	        })
	    	$('#index_hot'+id).removeClass('fa-times');
	    	$('#index_hot'+id).addClass('fa-check');
	        ch=1;
	    }else{
	    	$('#index_hot'+id).removeClass('fa-check');
	    	$('#index_hot'+id).addClass('fa-times');
	        ch=0;
	    	var index_hot =0;
	        $.post('index_hot',{id:id,index_hot:index_hot},function(){
	        	
	        })
	    }
	
	}


//banner  首页轮播
	var ch2 =0;
	function index_hot2(id){
	if(ch2==0){
			var index_hot =0;
		    $.post('index_hot',{id:id,index_hot:index_hot},function(){
		    	
		    })
			$('#index_hot'+id).removeClass('fa-check');
			$('#index_hot'+id).addClass('fa-times');
		    ch2=1;
	
	}else{
			var index_hot =1;
		    $.post('index_hot',{id:id,index_hot:index_hot},function(){
		    	
		    })
			$('#index_hot'+id).removeClass('fa-times');
			$('#index_hot'+id).addClass('fa-check');
		    ch2=0;
		}
	}
	
    </script>

</body>

</html>
